﻿using System;
using System.IO;

namespace ConsoleApp16
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo directortInfo = new DirectoryInfo("D:\\mySolo");
            directortInfo.Create();
            FileInfo fileInfo = new FileInfo("D:\\mySolo\\test.txt");
            if (!fileInfo.Exists)
            {
                fileInfo.Create().Close();
            }
            string path = "D:\\mySolo\\text.txt";
            StreamWriter streamWriter = new StreamWriter(path);
            streamWriter.WriteLine("喜欢听的歌不会打");
            streamWriter.WriteLine("我要睡了");
            streamWriter.Flush();
            streamWriter.Close();
        }
    }
}
